home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Info / TeachU14 / SAMS / Code / Day02 / forloop.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-08  |  719 b   |  28 lines

  1. //---------------------------------------------------------------------------
  2. #include <condefs.h>
  3. #include <conio.h>
  4. #include <iostream.h>
  5. #pragma hdrstop
  6.  
  7. //---------------------------------------------------------------------------
  8. //
  9. // We comment out the argc and argv variables to avoid
  10. // compiler warnings.
  11. //
  12. int main(int /*argc*/, char /***argv*/)
  13. {
  14.   cout << endl << "Starting program..." << endl << endl;
  15.   int i;
  16.   for (i=0;i<10;i++) {
  17.     cout << "Iteration number " << i << endl;
  18.   }
  19.   cout << endl;
  20.   for (i=10;i>0;i--) {
  21.     cout << "Iteration number " << i << endl;
  22.   }
  23.   getch();
  24.   return 0;
  25. }
  26. //---------------------------------------------------------------------------
  27.  
  28.